<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>demo</title>
    <!-- <script src="https://unpkg.com/vue@next"></script> -->
    <script src="https://unpkg.com/vue@3.0.5/dist/vue.global.js"></script>
  </head>

  <body>
    <div id="app"></div>
    <script>
      const app = Vue.createApp({
        data() {
          const a = 2;
          return {
            a: a,
            b: `<b>加粗</b>`,
            title: "标题",
            divName: "title",
            event: "click",
          };
        },
        methods: {
          add() {
            this.a++;
          },
          fn1() {
            console.log(111);
          },
        },
        template: `
          <div>
            <span v-html='b' />
            <div @click='add' v-once>{{a}}</div>
            <div @click='add'>{{a}}</div>
            <div @[event]='add'>{{a}}</div>
            <div v-bind:title='title' a='title'>1</div>
            <div :title='title'>2</div>
            <div :[divName]='title'>3</div>
            <form action='http://www.baidu.com/' @click.prevent='fn1'>
              <button type="submit">提交</button>
            </form>
          </div>
        `,
      });

      const vm = app.mount("#app");
    </script>
  </body>
</html>
